package com.lmscn.lms.api.model;

import com.jfinal.plugin.activerecord.Model;

@SuppressWarnings("serial")
public class LearnStatStudentRank extends Model<LearnStatStudentRank> {

    public static final LearnStatStudentRank dao = new LearnStatStudentRank();

    public LearnStatStudentRank getTongJi(Long studentId){
        String sql = "select sum(finished_required_period) as finished_required_period," +
                " sum(required_period) as required_period," +
                " sum(finished_optional_period) as finished_optional_period," +
                " sum(optional_period) as optional_period," +
                " sum(exam_score) as exam_score " +
                " from t_learn_stat_student_rank where student_id = ?";
        LearnStatStudentRank learnStatStudentRank = dao.findFirst(sql,studentId);

        return learnStatStudentRank;
    }
}
